#!/bin/sh
# Source tutorial run functions
#. $WM_PROJECT_DIR/bin/tools/RunFunctions

sed -i 's/\(startFrom \).*;/\1    startTime;/g' system/controlDict
sed -i 's/\(startTime \).*;/\1    450;/g' system/controlDict
sed -i 's/\(endTime \).*;/\1    6000;/g' system/controlDict
sed -i 's/\(stopAt \).*;/\1    endTime;/g' system/controlDict
sed -i 's/\(writeInterval \).*;/\1    100;/g' system/controlDict
sed -i 's/\(deltaT \).*;/\1    1;/g' system/controlDict

sed -i 's/\(turbulence \).*;/\1    on;/g' constant/RASProperties
sed -i 's/\(RASModel \).*;/\1    realizableKE;/g' constant/RASProperties
sed -i 's/\(application \).*;/\1    rhoSimpleFoam;/g' system/controlDict

sed -i 's/\(p \).*;/\1    0.01;/g' system/fvSolution #0.3
sed -i 's/\(rho \).*;/\1    0.05;/g' system/fvSolution
sed -i 's/\(U \).*;/\1    0.1;/g' system/fvSolution #0.7
sed -i 's/\(k \).*;/\1    0.05;/g' system/fvSolution
sed -i 's/\(epsilon\).*;/\1    0.025;/g' system/fvSolution
sed -i 's/\(h \).*;/\1    0.1;/g' system/fvSolution

mpirun -np 8 rhoSimpleFoam -parallel > log & pyFoamPlotWatcher.py log

#    p               0.01;//0.01;//OK
#    rho             0.05;//0.05;//OK
#    U               0.1;//0.1;//OK
#    k               0.05;//0.05;//OK
#    epsilon         0.025;//OK
#    h               0.1;//OK

